home *** CD-ROM | disk | FTP | other *** search
- :
- #
- # prep.s3cddx
- #
- # Copyright (C) 1991 Xware.
- #
-
- PATH=/bin:/usr/bin:/etc:/etc/conf/bin
- PERM=/etc/perms/inst # OS (link kit) permlist
-
- : ${OK=0} ${FAIL=1}
-
- #
- # exit with the status passed as argument
- #
-
- cleanup()
- {
- trap '' 1 2 3 15
- exit $1
- }
-
- #
- # prompt for yes or no answer with message passed as argument -
- # returns non-zero for no
- #
-
- getyn()
- {
- while echo "\n$* (y/n) \c">&2
- do read yn rest
- case $yn in
- [yY]) return 0 ;;
- [nN]) return 1 ;;
- *) echo "Please answer y or n" >&2 ;;
- esac
- done
- }
-
- #
- # test to see if link kit is installed
- #
-
- chklinkkit()
- {
- echo "Checking Link Kit installation..."
- until fixperm -i -d LINK $PERM 2> /dev/null
- do case $? in
- 3|4) echo "The Link Kit is not installed." >&2
- ;;
- 5) echo "The Link Kit is only partially installed." >&2
- echo "Attempting to remove TCP/IP package anyway." >&2
- return 0
- ;;
- *) echo "Error testing for Link Kit. Exiting."; cleanup 1
- ;;
- esac
-
- #
- # Not fully installed. Do so here
- #
-
- while echo "Do you wish to install it now? (y/n) \c"
- do read ANSWER
- case $ANSWER in
- Y|y) custom -o -i LINK
- break
- ;;
- N|n) echo "Driver cannot be removed without the Link Kit."
- cleanup 1
- ;;
- *) echo "Please answer 'y' or 'n'. \c"
- ;;
- esac
- done
- done
- }
-
- #
- # main()
- #
-
- cd /
-
- trap 'echo "\nInterrupted! Exiting ..."; cleanup 1' 1 2 3 15
-
- #
- # check for the linkkit and exit
- #
-
- chklinkkit
-
- cleanup 0
-
-